﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Exercise16
{
    internal class StrFun
    {
        public string StrResult;
        User UserCtrl;
        public User GetResult(string Instring)
        {
            UserCtrl = new User(false, "Pass");
            if (string.IsNullOrEmpty(Instring)) { UserCtrl.StrMsg = " is null "; return UserCtrl; }
            StrResult = StrClear(Instring);            
            return UserCtrl; 
        }
        private string StrClear(string Instring)
        {
            List<char> Chars = new List<char>();
            string Temp = Instring.ToLower(); 
            foreach (char item in Temp){
                if (!char.IsLower(item)) { Chars.Add(item); }                
            }
            return new string(Chars.ToArray());
        }
    }
}
